/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, {Component} from 'react';
import {
    AppRegistry, Button,
    StyleSheet,
    Text,
    View
} from 'react-native';
import {
    StackNavigator,
} from 'react-navigation';
import ProfileScreen from "./ProfileScreen";
import {notifications} from './NotificationManager'
export default class demo extends Component {
    static navigationOptions = {
        title: 'demo',
    };
    render() {
        return (
            <View style={styles.container}>
                <Button onPress={() => {
                    console.log("dddd")
                    this.props.navigation.navigate('Profile')
                }} title={"跳转到第二个界面"}></Button>

                <Button onPress={() => {
                    notifications.addNotification("aaaaaaa");

                }} title={"添加消息"}></Button>

                <Button onPress={() => {
                        notifications.logNotification();
                }} title={"打印log"}></Button>
            </View>
        );
    }
}


const App = StackNavigator({
    Main: {screen: demo,title:'fasdfasdfasd'},
    Profile: {screen: ProfileScreen},
});
const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: '#F5FCFF',
    },
    welcome: {
        fontSize: 20,
        textAlign: 'center',
        margin: 10,
    },
    instructions: {
        textAlign: 'center',
        color: '#333333',
        marginBottom: 5,
    },
});

AppRegistry.registerComponent('demo', () => App);
